
import { _decorator, Component, Node, Prefab, instantiate, sp, ImageAsset, dragonBones, resources } from 'cc';
const { ccclass, property } = _decorator;
 
@ccclass('AppLauncher')
export class AppLauncher extends Component {

    static Instance: AppLauncher = null;

    @property(Node)
    Canvas: Node = null;

    @property(Prefab)
    UIBattleEnd: Prefab = null;

    @property(Prefab)
    UIBattleField: Prefab = null;

    @property(Prefab)
    UICountdown: Prefab = null;

    @property(Prefab)
    PrefabCharacter: Prefab = null;

    @property([dragonBones.DragonBonesAsset])
    DragonBonesAsset: dragonBones.DragonBonesAsset[] = [];
     @property([dragonBones.DragonBonesAtlasAsset])
    DragonBonesAtlAsset: dragonBones.DragonBonesAtlasAsset[] = [];


    @property(ImageAsset)
    ImageAssetHealthPercent: ImageAsset = null;

    onLoad () {
        if (AppLauncher.Instance == null) {
            AppLauncher.Instance = this;
        } else {
            this.destroy(); // 注销该脚本对象

            return;
        }

        var uiBattleField = instantiate(this.UIBattleField); // 创建预制体对象 
        this.Canvas.addChild(uiBattleField);
    }

    start () {
    }

}